home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / doc / clippings / 930419-01 < prev    next >
Encoding:
Internet Message Format  |  1993-05-21  |  5.0 KB

  1. Date: Mon, 19 Apr 1993 14:03:52 -0400 (EDT)
  2. From: safdas@moose.wan.gs.com (Shabbir J Safdar)
  3. Subject: Re: DNS over TCP
  4. To: firewalls@GreatCircle.COM, brent@GreatCircle.COM
  5. Message-Id: <9304191803.AA00769@moose.wan.gs.com>
  6.  
  7. > From Firewalls-Owner@GreatCircle.COM Mon Apr 19 13:50:14 1993
  8. > Date: 19 Apr 1993 10:09:36 -0700
  9.  
  10. > Unfortunately, that's about the only option you have to keep folks
  11. > from exploiting security holes in RPC-based services such as NFS and
  12. > Yellow Pages (aka NIS).  By the nature of RPC, you don't know for
  13. > certain what UDP port an RPC-based server is going to end up using
  14. > (though NFS usually uses 2049; NFS is a special case, though, that's
  15. > more predictable than the others).  You end up having to block almost
  16. > all UDP in order to keep people from getting at your RPC-based
  17. > services.  Fortunately, most of the troublesome services aren't
  18. > offered under TCP, or you'd have the same problem there.
  19.  
  20. There are two other options.  To block access to NIS/YP, you should install
  21. Sun patch 100482.  It lets you specify, by subnet, who gets access to your
  22. NIS/YP services.  It really works too.  I had a co-worker setup a workstation
  23. over the weekend.  He was unable to use my NIS server because I had not
  24. given him permission in my /var/yp/securenets file.
  25.  
  26. Your second option (and one I would highly recommend) is to use the "securelib"
  27. product from William Lefebvre.  With it, you produce a new shared library
  28. for use by RPC daemons.  It intercepts the accept(), recvmsg(), and recvfrom()
  29. socket calls.  I've attached the README for it.  This product also gives
  30. you IP-level control over who connects to your RPC daemons.  I have tested
  31. it on 4.1.2 and 4.1.3 Sun systems.
  32.  
  33. -Shabbir
  34.  
  35. I've included the first part of the README.  The product can be ftp'ed from
  36. ftp.eecs.nwu.edu.
  37.  
  38. SunOS 4.1 secure C library package
  39.  
  40. Written by William LeFebvre, EECS Department, Northwestern University.
  41. Internet address: phil@eecs.nwu.edu
  42.  
  43. Code for reading the configuration file, along with a few important
  44. patches, was provided by Sam Horrocks of UCI (sam@ics.uci.edu).
  45.  
  46. OVERVIEW:
  47.  
  48. This package contains replacement routines for these three kernel
  49. calls: accept, recvfrom, recvmsg.  These replacements are compatible
  50. with the originals, with the additional functionality that they check
  51. the Internet address of the machine initiating the connection to make
  52. sure that it is "allowed" to connect.
  53.  
  54. Once compiled, these can be used when building a new shared libc.  The
  55. resulting libc.so can then be put in a special place.  Any program
  56. that should be protected can then be started with an alternate
  57. LD_LIBRARY_PATH.
  58.  
  59. What you need:
  60.         SunOS version 4.1, 4.1.1, or 4.1.2 (or 4.1.3 if there ever is one),
  61.         installation of the "shared library" option,
  62.         root access.
  63.  
  64. SunOS 5 (Solaris 2.0) users are on your own.  I have no idea if this
  65. will work with version 5 or its successors.
  66.  
  67. You can see if your machine has the shared library option installed by
  68. looking for the directory "/usr/lib/shlib.etc".  If it is not
  69. installed, then you will need to extract it from the distribution
  70. tapes (Sun-factory installed machines will NOT have it installed).
  71.  
  72. Do you need to use this?  If you can answer all of these questions
  73. with "yes", then this package will benefit you:
  74.  
  75.         Are you connected to the Internet (even via a local or
  76.         regional network)?
  77.  
  78.         Do all of the routers/gateways between your machine and the
  79.         "rest of the world" route all packets regardless of protocol
  80.         or port number?
  81.  
  82.         Are you concerned about the fact that any user on any system
  83.         anywhere on the Internet can connect to any network daemon
  84.         that runs on your machine, including ypserv and pwdauthd?
  85.  
  86. AVAILABILITY:
  87.  
  88. The latest version of securelib is available via anonymous FTP from
  89. the host "eecs.nwu.edu".  It is stored in the file "pub/securelib.tar".
  90. Remember to use the "binary" transfer mode!
  91.  
  92. DETAILS:
  93.  
  94. Each modified system call has the same basic algorithm:
  95.  
  96. {
  97.         int retval;
  98.  
  99.         if ((retval = syscall(...)) >= 0)
  100.         {
  101.                 if (_ok_address(socket, addr, *addrlen))
  102.                 {
  103.                         return (retval);
  104.                 }
  105.                 close(retval); /* this line: "accept" only */
  106.                 errno = ECONNREFUSED;
  107.                 return (-1);
  108.         }
  109.         return (retval);
  110. }
  111.  
  112. Connections that are established from a host that is not "okay" will
  113. be closed (if established via "accept"), then errno will be set to
  114. ECONNREFUSED and the calling application will get an error indication
  115. back from its system call.  It is assumed that the application will
  116. deal with such an error in an intelligent fashion.  All Sun daemons
  117. that we have tried seem to handle this correctly: they merely do the
  118. system call again.
  119.  
  120. The application will only see success for machines that "_ok_address"
  121. says are acceptable.  All other connections look like failures.
  122.  
  123. The function "_ok_address" reads a configuration file (normally
  124. "/etc/securelib.conf" or "/etc/security/securelib.conf") which
  125. describes what Internet address are acceptable.
  126.  
  127.  
  128.